﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Graph;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            Vertex v1 = new Vertex("v1");
            Vertex v2 = new Vertex("v2");
            Vertex v3 = new Vertex("v3");
            Vertex v4 = new Vertex("v4");
            Vertex v5 = new Vertex("v5");
            Vertex v6 = new Vertex("v6");
            Vertex v7 = new Vertex("v7");
            Vertex v8 = new Vertex("v8");

            v1.AddEdge(v2);
            v1.AddEdge(v3);
            v3.AddEdge(v4);
            v1.AddEdge(v5);
            v4.AddEdge(v6);
            v6.AddEdge(v7);
            v5.AddEdge(v8);

            BasicGraphImpl b = new BasicGraphImpl();
            IList<Vertex> vList = new List<Vertex>();
            vList = b.GetAllVertexesByBreadthFirst(v1);
            foreach (Vertex v in vList)
            {
                Console.WriteLine(v.getName());
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}
